package com.jason.basicandroid.contentprovider;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class ResourceDemo extends Activity {
	static final private int MAIN_ACTIVITY = 0;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
    
    public void onBtnClick(View v) {
    	Intent nextIntent = null;
    	
    	switch(v.getId()) {
    	case R.id.btnStrings:
    		nextIntent = new Intent(this, StringsDemo.class);
    		break;

    	case R.id.btnLayout:
    		nextIntent = new Intent(this, LayoutDemo.class);
    		break;

    	case R.id.btnColor:
    		nextIntent = new Intent(this, ColorDemo.class);
    		break;

    	case R.id.btnDimen:
    		nextIntent = new Intent(this, DimenDemo.class);
    		break;

    	case R.id.btnImage:
    		nextIntent = new Intent(this, ImageDemo.class);
    		break;

    	case R.id.btnColorDrawable:
    		nextIntent = new Intent(this, ColorDrawableDemo.class);
    		break;

    	case R.id.btnCommonXML:
    		nextIntent = new Intent(this, CommonXMLDemo.class);
    		break;

    	case R.id.btnRaw:
    		nextIntent = new Intent(this, RawDemo.class);
    		break;

    	case R.id.btnAssets:
    		nextIntent = new Intent(this, AssetsDemo.class);
    		break;    		
    	}
    	
    	if(nextIntent != null) {
    		startActivityForResult(nextIntent, MAIN_ACTIVITY);
    	}
    }
    
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    	switch(requestCode) {
    	case MAIN_ACTIVITY:
    		if(resultCode == RESULT_OK) {
    			
    		}
    		break;
    		
    	default:
    		break;
    	}
    }
}